package com.ziytek.web.citizen;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.swing.*;


/**
 * Spring Boot Admin监听服务端
 *
 * @author fenghx
 **/
@EnableAsync
@EnableScheduling
@EnableAdminServer
@SpringBootApplication
public class SpringBootAdminApplication {
    public static void main(String[] args) {
        // 使用端口占用情况,检查程序是否运行
        if (PortCheckerUtil.isPortInUse(ServerConstant.ADMIN_PORT)) {
            // 弹出窗口 提示
            JOptionPane.showMessageDialog(null, "服务监听程序已运行,请勿重复启动!");
            return;
        }

        SpringApplication.run(SpringBootAdminApplication.class, args);
    }
}
